package agentzia;

import java.io.Serializable;

public class Erreserba implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int erreserbaZenbakia;
    private java.util.Date data;
    private String agentearenKodea;
    private int pertsonaKop;
    private int irteeraKod = 717171;
    private int baieztapenZenb;
    private float prezioa;

    public Erreserba(int eZ, java.util.Date d, String aK, int pK, int iK, int bZ, float p) {
        this.erreserbaZenbakia = eZ;
        this.data = d;
        this.agentearenKodea = aK;
        this.pertsonaKop = pK;
        this.irteeraKod = iK;
        this.baieztapenZenb = bZ;
        this.prezioa = p;
    }

    public int getErreserbaZenbakia() {
        return this.erreserbaZenbakia;
    }

    public java.util.Date getData() {
        return this.data;
    }

    public String getAgentearenKodea() {
        return this.agentearenKodea;
    }

    public int getPertsonaKop() {
        return this.pertsonaKop;
    }

    public int getIrteeraKod() {
        return this.irteeraKod;
    }

    public int getBaieztapenZenb() {
        return this.baieztapenZenb;
    }

    public float getPrezioa() {
        return this.prezioa;
    }

    public void sartuErreserba(String turista) {
        // TODO: moldatu
        AplikazioDatuBase.instance().sartuErreserba(
                this.getErreserbaZenbakia(), this.getData(),
                this.getPertsonaKop(), this.getAgentearenKodea(),
                this.getIrteeraKod(), this.getBaieztapenZenb(),
                this.getPrezioa()*this.getPertsonaKop());
        AplikazioDatuBase.instance().sartuErreserbaTurista(turista, this.getErreserbaZenbakia());
    }
}
